Assignemnt #109 and 110th program
Code
///Name: Derrick Andreasen
///Period: 7
///Program name: 110th Program
///File name: Hund9prog.java
///Date Finished:4/14/2016
import java.util.Scanner;
import java.util.Scanner;
public class Hund9prog
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
String name;
int a = 0, top = 10;
System.out.print( "What is your name: " );
name = keyboard.next();
System.out.println( "" );
if(name.equals("Josh"))
top = 5;
for(a= 1; a<= top; a= a+1)
{
System.out.println( name );
}
}
}
Picture of the output